-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update eval and fix example #260
Conversation
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
model_args = f"pretrained={args.model},trust_remote_code={not args.disable_trust_remote_code}" | ||
if isinstance(args.tasks, str): | ||
tasks = args.tasks.split(',') | ||
res = simple_evaluate( | ||
model="hf", | ||
model_args=model_args, | ||
user_model=user_model, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "opt" in model_name:
seqlen = model.config.max_position_embeddings
model.seqlen = model.config.max_position_embeddings
else:
seqlen = 2048
model.seqlen = seqlen
seqlen = args.seqlen
remove 'model.seqlen = seqlen' this setting, this is only for ppl evaluation without using lm-eval model.seqlen = seqlen
device_str = detect_device(args.device) | ||
user_model = AutoModelForCausalLM.from_pretrained( | ||
args.model, | ||
device_map=device_str, quantization_config=quantization_config) | ||
model_args = f"pretrained={args.model},trust_remote_code={not args.disable_trust_remote_code}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reformat this file, there are many extra lines between codes
Signed-off-by: n1ck-guo <[email protected]>
|
||
model = model.eval() | ||
# align with GPTQ to eval ppl | ||
seqlen = args.seqlen | ||
if "opt" in model_name: | ||
seqlen = model.config.max_position_embeddings | ||
model.seqlen = model.config.max_position_embeddings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
No description provided.